<template>
  <div class="item" @click="xiangqingshare">
    <h3 v-html="item.title"></h3>
    <div class="fen">
      {{ item.content }}
    </div>
    <div class="huifu">
      <div class="userinfo">
        <img :src="baseURL + item.author.avatar" alt="" />
        <span class="name">{{ item.author.nickname }}</span>
      </div>
      <span class="time2">{{ item.updated_at | relativeTime }}</span>
      <span class="commont"
        ><i class="iconfont iconicon_pinglunliang"></i
        >{{ item.article_comments }}</span
      >
      <span class="damuzhi"
        ><i class="iconfont iconbtn_dianzan_big_nor"></i>{{ item.star }}</span
      >
    </div>
  </div>
</template>
<script>
export default {
  name: 'shareitem',
  props: ['item'],
  data () {
    return {
      // 基地址
      baseURL: process.env.VUE_APP_BaseURL
    }
  },
  methods: {
    xiangqingshare () {
      this.$emit('xiangqingshare')
    }
  },
  components: {}
}
</script>
<style lang="less" scoped>
.item {
  margin: 20px 0;
  padding: 0 15px;
  .fen {
    line-height: 20px;
    font-size: 16px;
    text-align: left;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
    text-align: left;
    color: #545671;
    margin: 15px 0;
  }
  .huifu {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #b4b4bd;
    .userinfo {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: left;
      .name {
        font-size: 12px;
        text-align: left;
        color: #545671;
      }
      img {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        margin-right: 10px;
      }
    }
    .time2 {
      margin-left: 20px;
    }
    .commont {
      display: flex;
      align-items: center;
      margin-left: 20px;
    }
    .damuzhi {
      display: flex;
      align-items: center;
      margin-left: 20px;
    }
  }
}
</style>
